<script src="../media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="../media/system/js/core.js" type="text/javascript"></script>
<form action="index.php?top=page&option=com_frleader" method="post" name="adminForm" id="adminForm">
    <!-- LEFT -->
    <?php echo $this->loadTemplate('search','default') ?>
    <!-- CONTENT -->
    <div id="jm-content">
       <h3 class="jm-title">
           <?php
           if($this->sr=='1')
           {
            echo '検索結果';
        }
        else echo '新着情報';
        ?>
    </h3>     
    <div class="info-basic">                                
        <table id="tb_blue">
            <tbody>
                <th>コード</th>
                <th>氏名</th>
                <th>所属</th>
                <th>常勤</th>
                <th>指導員資格</th>
                <th>有効期限</th>
                <th></th>
                <?php 
                $model=$this->getModel();
                $this->a =$model->getAllLeadColi();

                $rows = $this->rows;
                                //check group user
                $aut=new bgAuthorize();
                $group=$aut->getUserGroup();
                                //echo $group;                                                                                                
                if($rows != null){
                    foreach($rows as $k=>$row){
                        $a=$row->COCH_CODE;
                        $model=$this->getModel();


                        ?> 
                        <tr>
                            <td style="width: 5%;"><?php echo $row->COCH_CODE; ?></td>
                            <td style="width: 10%;"><?php echo $row->COCH_NAME; ?></td>
                            <td style="width: 22%;"><?php echo $row->OCBA_NAME;?></td>
                            <td style="width: 5%;text-align: center;"><?php if($row->COCH_WOKF ==1) echo "<font size='2' face='ＭＳ Ｐゴシック, Osaka' class='font03'>●</font>"; else echo ""; ?></td>

                        </td>
                        <td style="width: 20%;">
                        <?php                      
                            //$colis = $this->colis;
                            $model=$this->getModel();
                            $this->colis =$model->loadcoli($a);
                            if($this->colis != null){
                                $i=0;
                                foreach($this->colis as $k=>$coli){                                                                                               
                                    $i++;
                                    if($i == 1){
                                       echo $coli->COCM_NAME;
                                    }
                                    else{
                                        echo "<br />" . $coli->COCM_NAME;
                                    }
                                    echo '(';
                                    echo $coli->COLI_TERM; 
                                    if($coli->COLI_UNIT == 1) echo '回';
                                        else if  ($coli->COLI_UNIT == 2) echo '期';
                                        else if  ($coli->COLI_UNIT == 3) echo '年度';
                                    echo ')';
                                }
                            }
                        ?>                            
                        </td>
                        <td style="width: 13%;"><?php if($row->COCH_LDATE!='0000-00-00 00:00:00') echo HelperBG::F_GetDate_JP($row->COCH_LDATE); ?></td>
                        <td style="width: 7%;text-align:center">
                            <input style="display:none" type="checkbox" id="cb<?php echo $row->COCH_CODE ?>" name="cid" value="<?php echo $row->COCH_CODE ?>" onclick="Joomla.isChecked(this.checked);" />
                            <button onclick="document.id('cb<?php echo $row->COCH_CODE; ?>').checked=true;Joomla.submitbutton('detail');">詳細</button>
                        </td>
                    </tr>

                    <?php
                } 
            }else{
                ?>
                <tr>
                    <td class="center" colspan="8">データは見つかりませんでした</td>
                </tr>
                <?php    
            }
            ?>
        </tbody>


    </table>
    <table style="margin: auto;">
        <tfoot>
         <tr>
            <td colspan="15" style="text-align: center;">
                <?php echo $this->pagination->getListFooter(); ?>	
            </td>
        </tr>
    </tfoot>
</table>          

</div>
<div>
  <input type="hidden" name="task" id="task" value="" /> 

</div> 



</div>
<!-- END CONTENT -->
</form>                       

